var app = getApp();
// import { Config } from '../../utils/config.js';
import { Access } from '../../utils/access.js';
var Function = require("../../utils/function.js");
Page({
  onLoad: function (options) {
    var that = this;
  },
  
  bindGetUserInfo: function (e) {
    if (e.detail.errMsg == "getUserInfo:ok") {
      wx.getUserInfo({
        lang: "zh_CN",
        success: function (res) {
          var access = new Access();
          access.updateUserInfo(res.userInfo);
        }
      })
    } else {
      wx.showModal({
        title: '提示',
        content: '用户信息用于页面数据展示，请重新授权',
        success: function (res) {
          if (res.confirm) {
            wx.showToast({
              title: '请重新授权',
              icon: 'loading',
              duration: 1000
            })
          } else if (res.cancel) {
            wx.showModal({
              title: '友情提示',
              content: '为了更好的用户体验，请重新授权',
              success: function (res) {
                if (res.confirm) {

                } else if (res.cancel) {

                }
              }
            })
          }
        }
      })
    }
  }
})